// 引入
import Request from '@/libs/request'
import qs from 'qs'
import axios from 'axios'


// 使用枚举包含所有的path
enum Api {
  // 查询设备列表
  selectDevList = '/platFormSubUser/select/devList',
  // 提交采集频率快捷配置数据
  submitQuickCollectRate = '/platFormSubUser/add/quickCollectRate'
}



// 查询设备列表的Api
export const selectDevListApi = (data: { platFormSubUserId: string | number | null }) => {
  return Request.post(Api.selectDevList, qs.stringify(data))
}


// 提交采集频率快捷配置数据的Api
export const submitQuickCollectRateApi = (data: { devIds: string, devCRValue: string | number }) => {
  let token = localStorage.getItem('token')
  let platFormSubUserId = localStorage.getItem('platFormSubUserId')
  return axios({
    method: 'post',
    url: 'http://192.168.0.161:11006' + Api.submitQuickCollectRate,
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'accessToken': token,
      'platFormSubUserId': platFormSubUserId
    }
  })
}

